home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / DELAY < prev    next >
Encoding:
Text File  |  1985-12-14  |  1.0 KB  |  34 lines

  1. ;-------------------------delay routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page :169
  4. ; NAME DELAY
  5. ; ROUTINE FOR delaying a specified number of milliseconds
  6. ;
  7. ; FUNCTION: This routine delays a specified number of milliseconds
  8. ; INPUT: Upon call CX contains the number of milliseconds to delay
  9. ; OUTPUT: None
  10. ; REGISTERS USED:  None modified
  11. ; SEGMENTS REFERENCED:  None
  12. ; ROUTINES CALLED:  None
  13. ; SPECIAL NOTES: None
  14. ;
  15. ; Routine to delay a specified number of milliseconds
  16. ;
  17. delay    proc    far
  18. ;
  19.     push    cx        ; save registers
  20. ;
  21. delay1:
  22.     push    cx        ; save counter
  23.     mov    cx,260        ; timing constant
  24. delay2:
  25.     loop    delay2        ; small loop
  26.     pop    cx        ; restore counter
  27.     loop    delay1        ; loop to count milliseconds
  28. ;
  29.     pop    cx        ; restore registers
  30.     ret            ; return
  31. ;
  32. delay    endp
  33. ;-------------------------delay routine ends---------------------------+
  34.